//
//  CodeBarViewController.m
//  跨界收
//
//  Created by Allen on 2018/10/27.
//  Copyright © 2018年 gztx. All rights reserved.
//

#import "CodeBarViewController.h"

@interface CodeBarViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *Yconstraint;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomContraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightConstant;
//第二种
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *headerConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *widthConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *CodeHContraint;
@property (weak, nonatomic) IBOutlet UIButton *leftItem;
@property (weak, nonatomic) IBOutlet UIView *naviView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *footerHContraint;

@end

@implementation CodeBarViewController
- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    
    if (self.naviHidden == YES) {
        if (WYFIphoneX) {
            self.Yconstraint.constant = 40;
        }
        if (SCREEN_WIDTH > 375.0) {
            self.bottomContraint.constant = 60;
        }else{
        if (SCREEN_HEIGHT == 480) {
            self.bottomContraint.constant = 0;
        }
        }
        self.naviView.hidden = NO;
    }else{
        if (SCREEN_WIDTH > 375.0) {
            if (WYFIphoneX) {
                self.Yconstraint.constant = 40;
            }
            self.bottomContraint.constant = 60;
        }else{
            self.bottomContraint.constant = 0;
            self.Yconstraint.constant = 0;
            self.widthConstraint.constant = 130;
            self.CodeHContraint.constant = 130;
            self.headerConstraint.constant = 113;
        }
        self.naviView.hidden = YES;
    }
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    if (self.naviHidden == YES) {
        self.navigationController.navigationBarHidden = YES;
    }
}
- (IBAction)click:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"收款码";
    // Do any additional setup after loading the view from its nib.
}

@end
